﻿namespace EyeOpen.DddOrm.Data.Test
{
	using System;

	using EyeOpen.DddOrm.Domain.Factories;

	using Microsoft.VisualStudio.TestTools.UnitTesting;

	using SharpTestsEx;

	[TestClass]
	public class CategoryFactoryTest
	{
		[TestMethod]
		public void CreateCategoryWithNullNameThrowException()
		{
			Executing
				.This(() => CategoryFactory.Create(null))
				.Should()
				.Throw<ArgumentException>();
		}

		[TestMethod]
		public void CreateCategoryWithEmptyNameThrowException()
		{
			Executing
				.This(() => CategoryFactory.Create(string.Empty))
				.Should()
				.Throw<ArgumentException>();
		}

		[TestMethod]
		public void CreateCategoryWithSpacesNameThrowException()
		{
			Executing
				.This(() => CategoryFactory.Create("    "))
				.Should()
				.Throw<ArgumentException>();
		}

		[TestMethod]
		public void CreateCategoryWithNullParentThrowException()
		{
			Executing
				.This(() => CategoryFactory.Create("name", null))
				.Should()
				.Throw<ArgumentNullException>();
		}
	}
}